package com.szq.pattern.service.engine.impl;

import com.szq.pattern.po.aggregates.TreeRich;
import com.szq.pattern.po.vo.EngineResult;
import com.szq.pattern.po.vo.TreeNode;
import com.szq.pattern.service.engine.EngineBase;

import java.util.Map;

/**
 * @description:
 * @author: szq
 * @date: 2021-09-08 08:59:28
 */
public class TreeEngineHandle extends EngineBase {

    @Override
    public EngineResult process(Long treeId, Long userId, TreeRich treeRich, Map<String, String> decisionMatter) {
        // 决策流程
        TreeNode treeNode = engineDecisionMaker(treeRich, treeId, userId, decisionMatter);
        // 决策结果
        return new EngineResult(userId, treeId, treeNode.getTreeNodeId(), treeNode.getNodeValue());
    }
}
